package dao;

import java.util.*;

import org.hibernate.Session;

import entity.*;

/**
 * GENERATED CODE - Please do not change
 */

public class LvaDAO implements DAO<Lva> {
	public Lva load(final long id) {
		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
		Lva lva = (Lva) session.load(Lva.class, id);
		return lva;
	}

	public List<Lva> loadAll() {
		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
		List<Lva> result = session.createQuery("SELECT l FROM Lva l").list();
		return result;
	}

	public void persist(final Lva lva) {
		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
		session.saveOrUpdate(lva);
	}

	public void update(final Lva lva) {
		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
		session.saveOrUpdate(lva);
	}

	public void delete(final long id) {
		Session session = HibernateUtil.getSessionFactory().getCurrentSession();
		Lva lva = (Lva) session.load(Lva.class, id);
		session.delete(lva);
	}
}
